package jieKeXiangMu;

import java.io.*;
import java.util.*;
public class managementSystem {
	Dormitory dormitory = new Dormitory();
	
	public static void main(String args[]) {
		managementSystem system = new managementSystem();
		System.out.println("**** 确认进入学生宿舍管理系统请输入数字：0 ****");
		system.start();
	}

	public void start() {
		Scanner scanner = new Scanner(System.in);
		int number = scanner.nextInt();
		if(number == 0) {
			File f = new File("D:\\计算机\\大二上\\文件\\Pro6\\src\\jieKeXiangMu\\宿舍资源.txt");
			System.out.println("* 系统定义宿舍资源：*");
			try {
				FileInputStream fi = new FileInputStream(f);
			    InputStreamReader ir = new InputStreamReader(fi);
		        BufferedReader br = new BufferedReader(ir);
		        String line;
		        while((line=br.readLine())!=null) {
		        	System.out.println(line);
		        }
		        br.close();
		     }catch(Exception exp) {
					System.out.println(exp);
			 }
		    
			System.out.println("** 系统功能选择（请输入对应数字1~6）： **");
			System.out.println("1：录入学生信息");
			System.out.println("2：信息查询");
			System.out.println("3：安排学生入住");
			System.out.println("4：导出学生住宿信息");
			System.out.println("5：宿舍卫生情况（差）展示");
			System.out.println("6：退出系统");
			
		}
		while(true) {
			int choice = scanner.nextInt();
			switch(choice) {
		    case 1:
		    	dormitory.student();
		        break;
		    case 2:
		    	dormitory.inquiry();
		    	break;
		    case 3:
		    	dormitory.accommodation();
		    	break;
		    case 4:
		    	dormitory.educe();
		    	break;
		    case 5:
		    	dormitory.sanitation();
		    	break;
		    case 6:
		    	System.out.println("退出系统！");
		    	scanner.close();
		    	return;
		    default:
		    	System.out.println("请重新输入：");
		    }
		}
	}
}
